<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 秋与月
  Date: 2022/11/30
  Time: 14:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="<c:url value="../css/bootstrap-icons.css"/>">
    <link rel="stylesheet" href="<c:url value="/css/bootstrap.min.css"/>">
    <link rel="stylesheet" href="<c:url value="/css/bootstrap-admin.min.css"/>">
    <link rel="stylesheet" href="<c:url value="/css/style.css"/>">
    <title>个人信息主页</title>
</head>
<body onload="checkForm()">
<div class="bsa-main-wrapper">
    <div class="bsa-main-content">
        <div class="card border-0 shadow-sm">
            <div class="card-body p-4">

                <div class="row">

                    <div class="col-lg-8">
                        <div class="card">
                            <div class="card-body">

                                <form action="/manager/update" id="form2" method="post">
                                    <div class="mb-3 row">
                                        <label for="username" class="col-sm-3 col-form-label">用户名</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" id="username" name="username"
                                                   disabled
                                                   value="<c:out value="${manager.username}" />">
                                        </div>
                                    </div>
                                    <div class="mb-3 row">
                                        <label for="email" class="col-sm-3 col-form-label">邮箱</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" id="email" name="email"
                                                   onfocus="if(value=='${manager.email}') {value=''}"
                                                   onblur="if (value=='') {value=${manager.email}}"
                                                   value="<c:out value="${manager.email}" />">
                                        </div>
                                    </div>
                                    <div class="mb-3 row">
                                        <label for="phone" class="col-sm-3 col-form-label">手机号</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" id="phone" name="phone"
                                                   value="<c:out value="${manager.phoneNum}" />">
                                        </div>
                                    </div>
                                    <div class="mb-3 row">
                                        <label for="gender2Radio1" class="col-sm-3 col-form-label">性别</label>
                                        <div class="col-sm-9">
                                            <c:choose>
                                            <c:when test = "${ manager.isMale == 1 }">
                                            <div class="form-check form-check-inline">
                                                <input class="form-check-input" type="radio" name="gender2"
                                                       id="gender2Radio1" value="先生" checked>
                                                <label class="form-check-label" for="gender2Radio1">先生</label>
                                            </div>

                                            <div class="form-check form-check-inline">
                                                <input class="form-check-input" type="radio" name="gender2"
                                                       id="gender2Radio2" value="女士">
                                                <label class="form-check-label" for="gender2Radio2">女士</label>
                                            </div>
                                            </c:when>
                                                <c:otherwise>
                                                    <div class="form-check form-check-inline">
                                                        <input class="form-check-input" type="radio" name="gender2"
                                                               id="gender2Radio3" value="先生">
                                                        <label class="form-check-label" for="gender2Radio1">先生</label>
                                                    </div>

                                                    <div class="form-check form-check-inline">
                                                        <input class="form-check-input" type="radio" name="gender2"
                                                               id="gender2Radio4" value="女士" checked>
                                                        <label class="form-check-label" for="gender2Radio2">女士</label>
                                                    </div>

                                                </c:otherwise>
                                            </c:choose>
                                        </div>
                                    </div>

                                    <div class="mb-3 row">
                                        <label for="password" class="col-sm-3 col-form-label">密码</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" id="password" name="password"
                                                   value="<c:out value="${manager.password}" />">
                                        </div>
                                    </div>

                                    <div class="mb-3 row">
                                        <div class="col-sm-9 offset-sm-3">
                                            <input type="submit" class="btn btn-primary" value="保存更改">
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>

                    </div>
                    <div class="col-lg-4">
                        <div class="card">
                            <div class="card-body">
                                <div class="d-flex flex-column align-items-center text-center">
                                    <img src="<c:url value="/img/img_1.png"/>" alt="Admin" class="rounded-circle p-1 bsa-bg-color4 bsa-width-100">
                                    <div class="mt-3">
                                        <h4><c:out value="${manager.username}" /></h4>

                                        <c:choose>
                                            <c:when test = "${ manager.isSuper == 1 }">
                                        <p class="text-secondary mb-1">超级管理员</p>
                                            </c:when>
                                            <c:otherwise>
                                                <p class="text-secondary mb-1">管理员</p>
                                            </c:otherwise>
                                        </c:choose>
                                        <p class="text-muted font-size-sm">Web 开发小组</p>
                                    </div>
                                </div>
                                <hr class="my-4">
                                <ul class="list-group list-group-flush">
                                    <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
                                        <h6 class="mb-0"><i class="bi bi-globe bsa-font-20"></i> gitee网址</h6>
                                        <span class="text-secondary">https://gitee.com/liu-Carrot/questionnaire-system</span>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function checkForm() {
        var flag = '<%=request.getAttribute("message")%>';
        if(flag != "null") {
            alert(flag);
        }
    }
</script>
<script src="<c:url value="/js/bootstrap.bundle.js"/>"></script>
<script src="<c:url value="/js/bootstrap-admin.min.js"/>"></script>


</body>
</html>
